public class BankAccout {
    private double balance;

    public BankAccout(double initialBalance) {
        this.balance = initialBalance;
    }

    public void deposit(double amount) {
        balance += amount;
        System.out.println("Deposited:$" + amount);
        System.out.println("New balance:$" + balance);
    }

    public void withdraw(double amount) {
        balance -= amount;
        System.out.println("Withdrew:$" + amount);
        System.out.println("New balance:$" + balance);
    }

    public double getBalance() {
        return balance;
    }

    private void printBalance() {
        System.out.println("Balance(should not be directly accessible):$" + balance);
    }

    public static void main(String[] args) {
        BankAccout account = new BankAccout(1000);
        account.deposit(500);
        account.withdraw(200);
        System.out.println("Account balance:$" + account.getBalance());
    }

}
